-
Notifications
You must be signed in to change notification settings - Fork 415
Expose reply_path
from Responder
in onion messenger
#3906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 I see @valentinewallace was un-assigned. |
@@ -413,6 +413,11 @@ impl Responder { | |||
Responder { reply_path } | |||
} | |||
|
|||
/// Returns the reply path for this [`Responder`]. | |||
pub fn reply_path(&self) -> BlindedMessagePath { | |||
self.reply_path.clone() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand why this needs to be cloned. Can't we return a reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I thought it would be safer not returning a reference. (stuck on C, my bad, is not mutable)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries! Regarding needing a direct connection, when sending a message over the reply path with OnionMessenger
it should buffer the message if it needs a connection with the introduction node. Then you can use OnionMessenger::process_pending_events
to process any ConnectionNeeded
events. Once connected and OnionMessenger::peer_connected
is called, the buffered message will be released upon calling OnionMessenger::next_onion_message_for_peer
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I see, thank you!
I'd need to do a bigger refactor than I thought. We aren't using events of connection needed or awaiting connection in any of our flows. We currently use next_onion_message_for_peer
to buffer the message and then dequeue it sending it through lnd. But all the time we do separately the process of trying to connect to peer and then sending messages.
Said so, I'm closing this as is probably our implementation issue.
Add public `reply_path()` method to allow external process or implementation to access the introduction node information before responding the onion message.
cc10483
to
4256944
Compare
Context
When using responder from
OnionMessenger
and using an external process to interact with the messages (our case in LNDK, using LND) we need to try to connect to the introduction node before responding to the message itself.What it is implemented
Just exposing the reply path from the responder.